package user

import (
	"time"

	"gitee.com/xgotool/backend-framework-template/model"
	"gitee.com/xiaoyutab/xgotool/individual/xginplus"
	"gitee.com/xiaoyutab/xgotool/individual/xqueue"
)

// 用户退出方法
//
//	POST	/user/logout
func Logout(c *xginplus.Context) *xginplus.Response {
	xqueue.Set("log.user", &model.UserLog{
		Uid:  c.GetUint("uid"),
		Type: 2,
		Ip:   c.ClientIP(),
		Ua:   c.Request.UserAgent(),
		Time: time.Now().Unix(),
	})
	return c.SuccessEmpty()
}
